home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
287_01
/
gradegs.gcm
< prev
next >
Wrap
Text File
|
1989-05-23
|
4KB
|
87 lines
font1=LoadFont("amr14.fon"); /* the font will be used later */
env1=EnvSave(0); /* save the initial environment setting */
HorzLine(0,0,100,1); /* solid horizontal line */
VertLine(200,0,50,1); /* solid vertical line */
SetStyle(0x3333); /* then different style of horizontal and */
HorzLine(0,10,100,1); /* vertical lines */
VertLine(210,0,50,1);
SetStyle(0);
HorzLine(0,20,100,1);
VertLine(220,0,50,1);
SetStyle(0x11ff);
HorzLine(0,30,100,1);
VertLine(230,0,50,1);
WriteStr(0,0,0,50,"HorzLine",0,0); /* label the horizontal lines */
WriteStr(3,2,240,0,"VertLine",0,0); /* label the vertical lines */
RelOrg(0,60); /* move down the origin */
SetStyle(0x3333);
Circle(50,50,50); /* Circle is not affected by style */
WriteStr(0,0,23,55,"Circle",0,0);
Arc1(200,50,52,0xff); /* but Arc1 does */
WriteStr(0,0,182,55,"Arc1",0,0);
FillEllipse(400,50,80,30); /* completely filled ellipse */
temp2=PlotType(1); /* change plot type and save old type in temp2 */
WriteStr(0,0,353,55,"FillEllipse",0,0);
PlotType(temp2);
SetStyle(0xffff);
Earc2(570,50,60,50,100,270); /* Draws a arc with length 270 degrees */
ArcPoint(&x1,&y1,&x2,&y2); /* draws two lines and become a sector */
Line(x1,y1,570,50);
Line(570,50,x2,y2);
env2=EnvSave(0); /* <-+ save current environemnt */
SetWin(570,50,570,50); /* | define a one-point window */
Earc2(570,50,60,50,100,135); /* | so the arc is not drawn */
ArcPoint(&x1,&y1,&x2,&y2); /* | but the starting and ending point */
/* | coordinates are stilled calculated */
EnvRsto(env2,0); /* <-+ restore the original window setting */
Line(x2,y2,570,50); /* only draw a line for one end point */
Earc2(578,45,60,50,10,90); /* draw another arc with different center */
ArcPoint(&x1,&y1,&x2,&y2); /* complete the sector */
Line(x1,y1,578,45);
Line(578,45,x2,y2);
PatternFill(560,40,pattern2,0); /* fill the three different region with */
PatternFill(570,60,pattern3,0); /* different pattern */
PatternFill(590,30,pattern1,0);
SetOrg(0,195);
font2=SelectFont(font1);
WriteStr(0,0,100,0,"Examples",0,0); /* an example on text display */
NextXY(&x1,&y1);
Line(100,0,x1,y1);
PrintPage();
EnvRsto(env1,0); /* restore environment on start time */
/* an example on Draw */
Draw("NW DN12 RT16 AS0xc0 EL16,12 UP12 WR RT600",0,0);
Draw("NW DN12 AS0x03 EL16,12 RT16 WR DN160",0,0);
Draw("NW LF16 AS0x0c EL16,12 DN12 WR LF600",0,0);
Draw("NW UP12 AS0x30 EL16,12 LF16 WR UP160",0,0);
SetOrg(99,19);
HorzLine(8,6,204,104); /* draw a rectangular plane */
PlotType(1);
HorzLine(0,0,205,105); /* clear most part of it */
PlotType(0);
Rectangle(0,0,203,103); /* draw a outline */
RelOrg(1,1);
SetWin(0,0,200,100); /* create window 1 */
temp1=EnvSave(0); /* save window 1 environment */
SetOrg(400,20); /* create window 2 environment */
SetWin(0,0,100,100);
HorzLine(0,0,1000,1000);
PlotType(1);
temp2=EnvSave(0); /* save the environment */
Circle(50,50,55);
Line(0,0,200,200);
Line(100,0,0,100);
EnvRsto(temp1,0x8000); /* restore window 1 environment and keep the slot */
WriteStr(0,0,0,10,
"This window is not affected",0,0);
WriteStr(0,0,0,20,
"By the other window.",0,0);
EnvRsto(temp2,0x8000); /* restore window 2 environment and keep the slot */
Box(5,5,90,90,2,2);
SolidFill(40,50);
PrintPage();